package com.cxt.context;
//线程存储
public class BaseContext {

    //存储id
    public static ThreadLocal<Long> threadLocal = new ThreadLocal<>();
    //存储员工编号id
    public static ThreadLocal<Long> employeeIdThreadLocal = new ThreadLocal<>();

    public static void setCurrentId(Long id) {
        threadLocal.set(id);
    }

    public static Long getCurrentId() {
        return threadLocal.get();
    }

    public static void removeCurrentId() {
        threadLocal.remove();
    }

    //存储员工编号id
    public static void setEmployeeId(Long id) {employeeIdThreadLocal.set(id);}
    //获取员工编号id
    public static Long getEmployeeId() {return employeeIdThreadLocal.get();}
}
